package flib;

import java.util.HashMap;
import java.util.TreeMap;
import java.util.Vector;

import processing.core.PImage;
import simpleGeom.Bounds2D;
import simpleGeom.Rect2D;

public class FlibBuilding {
	String name;
	HashMap<String,String>metaData=new HashMap<String,String>();
	Vector<FlibLevel> levels = new Vector<FlibLevel>();
	TreeMap<String, FlibLevel> levelMap = new TreeMap<String, FlibLevel>();

	public Rect2D getBounds2D() {
		Bounds2D bounds = new Bounds2D();
		boolean hasNodes = false;
		for (int i = 0; i < levels.size(); i++) {
			FlibLevel l = levels.get(i);
			if (l.nodes.size() > 0)
				hasNodes = true;
			bounds.addAll(l.nodes);
		}
		if (hasNodes)
			return bounds;
		return new Rect2D(0, 0, 1000, 1000);
	}
}
